<?php
// $Id: header.php,v 1.2 2005/03/18 12:52:25 onokazu Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <http://www.xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

include "../../mainfile.php";

//wanikoo
$news_theme = "newsdefault";

$news_allowed_theme = array("newsdefault", "newsdefault-RW", "newsdefault-LW", "newsdefault-BW");

if (!empty($_POST['news_theme_select']) && in_array($_POST['news_theme_select'], $news_allowed_theme)) {
       		$news_theme = $_POST['news_theme_select'];
       		$_SESSION['newsUserTheme'] = $_POST['news_theme_select'];
} elseif (!empty($_SESSION['newsUserTheme']) && in_array($_SESSION['newsUserTheme'], $news_allowed_theme)) {
       		$news_theme = $_SESSION['newsUserTheme'];
}

//wanikoo
if( in_array($news_theme, $news_allowed_theme) ) {
$valid_theme = true;
}
else {
$valid_theme = false;
}

$news_wide_theme = false;
$news_right_wide_theme = false;
$news_left_wide_theme = false;
$news_both_wide_theme = false;

if ((strpos($news_theme, '-RW')||strpos($news_theme, '-w')) && ($valid_theme === true)) {
$news_wide_theme = true;
$news_right_wide_theme = true;
}
elseif (strpos($news_theme, '-LW') && ($valid_theme === true)) {
$news_wide_theme = true;
$news_left_wide_theme = true;
}
elseif (strpos($news_theme, '-BW') && ($valid_theme === true)) {
$news_wide_theme = true;
$news_both_wide_theme = true;
}


$modulename = basename( dirname( __FILE__ ) );

define('XOOPSNEWSURL', XOOPS_URL."/modules/$modulename");
define('XOOPSNEWSPATH', XOOPS_ROOT_PATH."/modules/$modulename");
define('XOOPSNEWSINCURL', XOOPSNEWSURL."/include");
define('XOOPSNEWSINCPATH', XOOPSNEWSPATH."/include");
define('XOOPSNEWSIMGURL', XOOPSNEWSURL."/images");
define('XOOPSNEWSIMGPATH', XOOPSNEWSPATH."/images");

include_once XOOPSNEWSPATH."/include/functions.php";

//wanikoo
$news_show_extrafunc = true;
$news_show_logo = true;
$news_show_toolbar = true;
$news_show_letters = true;
$news_show_search = true;
if (strpos($GLOBALS['xoopsRequestUri'],'article.php')) {
$news_hide_extrafunc = true;
}
else {
$news_hide_extrafunc = false;
}
//ver3.0
$news_show_externalsearch = false;
$news_show_xoopssearch = true;

//ver3.1
$news_show_feed = true;
$news_show_themechanger = true;

$news_adcodes = array();
$news_adcodes['all'] = '';
$news_adcodes['index'] = '';
$news_adcodes['article'] = '';
$news_adcodes['archive'] = '';
$news_adcodes['submit'] = '';

//wanikoo
// disallow=0, allow =1, memberonly =2
$news_can_print = 1;
$news_can_pdf = 1;
$news_can_friend = 1;
$news_can_bookmark = 1;
//if qrcode module exists 
if ( file_exists(XOOPS_ROOT_PATH."/modules/qrcode/qrcode_image.php") ) {
// disallow=0, allow =1, memberonly =2
$news_can_qrcode = 2;
}
else {
//no qrcode module
$news_can_qrcode = 0;
}


//logo
if ( $news_show_logo && !is_dir(XOOPSNEWSIMGPATH."/".$news_theme."/newslogo.gif") && file_exists(XOOPSNEWSIMGPATH."/".$news_theme."/newslogo.gif") ) {
	$logoimage = "<a href='".XOOPSNEWSURL."/index.php'><img src='".XOOPSNEWSIMGURL."/".$news_theme."/newslogo.gif' border='0' alt='' /></a>";
}
elseif ( $news_show_logo && !is_dir(XOOPSNEWSIMGPATH."/newslogo.gif") && file_exists(XOOPSNEWSIMGPATH."/newslogo.gif") ) {
	$logoimage = "<a href='".XOOPSNEWSURL."/index.php'><img src='".XOOPSNEWSIMGURL."/newslogo.gif' border='0' alt='' /></a>";
}
else {
	$logoimage = "";
}

?>